<?php

class Start extends CI_Controller
{
	public function index()
	{
		//Determine if the user is loged in.
		user_authorization(1);
		
		//Creating an user object.
		$this->load->model('m_user', 'user'); //Create object.
		$user_id = $this->session->userdata('user_userid'); //Get user id.
		$this->user->load_userdata($user_id); //Load the object.
		
		//Getting user information that are to be displayed.
		$page_data = $this->user->get_info(array('username', 'signup'));
		
		//Calculating for how long the user has been registred (for view on start page).
		$page_data['time_since_signup'] = $this->namustar->time_difference_string($page_data['signup']);
		
		//Load views.
		$this->load->view('templates/v_header');
		$this->load->view('templates/v_menu_logedin');
		$this->load->view('pages/v_start', $page_data);
		$this->load->view('templates/v_footer');
	}
}
?>